//
//  XTWebSocket.h
//  MyStock
//
//  Created by 刘翔 on 2024/10/17.
//

#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>

NS_ASSUME_NONNULL_BEGIN

@protocol XTWebSocketDelegate <NSObject>
@optional
- (void)xtWebSocketDidReceiveMessage:(NSString *)message;
@end

@interface XTWebSocket : NSObject
@property (nonatomic,weak) id <XTWebSocketDelegate> delegate;
- (instancetype)initWithServerIp:(NSString *__nullable)serverIp;
- (void)connectWebSocket;
- (void)closeWebSocket;

- (void)sendMsg:(NSString *)msg;

@end
NS_ASSUME_NONNULL_END
